import request from '@/utils/request'

export function getBooks(categoryId = null) {
    return request({
        url: '/books',
        method: 'get',
        params: categoryId ? { categoryId } : {}
    })
}

export function getBookCategories() {
    return request({
        url: '/book-categories',
        method: 'get'
    })
}

export function getBookDetail(id) {
    return request({
        url: `/books/${id}`,
        method: 'get'
    })
} 